// file:api.js
// 1、导入axios以及拦截器
import service from './request'

export const companyList = () => {
    return service({
        url: '/purchase/company/list',
        method: 'get'
    })
};

export const projectList = () => {
    return service({
        url: '/purchase/project/list',
        method: 'get'
    })
};

export const goodsListAll = () => {
    return service({
        url: '/purchase/goods/listAll',
        method: 'get'
    })
};

export const goodsList = () => {
    return service({
        url: '/purchase/goods/list',
        method: 'get'
    })
};

export const typeList = () => {
    return service({
        url: '/purchase/type/list',
        method: 'get'
    })
};

export const initForm = () => {
    return service({
        url: '/purchase/initForm',
        method: 'get'
    })
};

export const submitForm = (data) => {
    return service({
        url: '/purchase/save',
        method: 'post',
        data
    })
};

export const list = () => {
    return service({
        url: '/purchase/list',
        method: 'get'
    })
};

export const submitApprove = (id) => {
    return service({
        url: '/purchase/submitApprove/'+id,
        method: 'put'
    })
};

export const edit = (id) => {
    return service({
        url: '/purchase/find/'+id,
        method: 'get'
    })
};

export const approve = (id, status) => {
    return service({
        url: '/purchase/approve/'+id+'?status='+status,
        method: 'put'
    })
};
